package com.itcodai.controller.course13;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author c-fanqj
 * @date 2023/4/11
 * @apiNote 拦截器测试类
 */
@Controller
@RequestMapping("/interceptor")
@Api(value = "拦截器操作")
public class InterceptorController {

    private final Logger logger =
            LoggerFactory.getLogger(this.getClass());

    @GetMapping("/test")
    @ApiOperation(value = "跳转页面")
    public String test() {
        return "hello";
    }

    @UnInterception  // 不拦截注解
    @GetMapping("/test2")
    @ResponseBody
    @ApiOperation(value = "过滤拦截接口")
    public String test2() {
        return "我没有被拦截";
    }

}
